<template>
  <section class="sp-section">
    <section class="oa-form" id="printTest" v-if="approve">
        <!--行政助理-->
       <administrative-assistant  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 17 || approve.approve_id == 17"></administrative-assistant>
       <!--行政主管-->
       <authoritie  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 16 || approve.approve_id == 16"></authoritie>
       <!--航空事业部业务经理、业务总监绩效考核评定表-->
       <aviation-manager  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 10 || approve.approve_id == 10"></aviation-manager>
       <!--航空部总经理绩效考核-->
       <aviation-president  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 9 || approve.approve_id == 9"></aviation-president>
       <!--抖音部运营绩效考核-->
       <b-d ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 24 || approve.approve_id == 24"></b-d>
       <!--BD部运营绩效考核-->
       <b-doperate  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 25 || approve.approve_id == 25"></b-doperate>
       <customer  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 13 || approve.approve_id == 13"></customer>
       <!--设计主管-->
       <design ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 11 || approve.approve_id == 11"></design>
       <!--设计助理-->
       <design-assistant  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 12 || approve.approve_id == 12"></design-assistant>
       <!--信息管理员考核-->
       <infotemp  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 15 || approve.approve_id == 15"></infotemp>
       <!--工程部绩效考核-->
       <project  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 14 || approve.approve_id == 14"></project>
       <!--业务总经理绩效考核-->
       <yw-manager ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 7 || approve.approve_id == 7"></yw-manager>
       <!--业务经理、业务总监绩效考核-->
       <yw-manager2 ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 8 || approve.approve_id == 8"></yw-manager2>
       <!--cashier 出纳绩效考核-->
       <cashier  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 20 || approve.approve_id == 20"></cashier>
       <!--销售会计-->
       <cashierSale  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 22 || approve.approve_id == 22"></cashierSale>
       <!--主办会计-->
       <cashierHost ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 21 || approve.approve_id == 21"></cashierHost>
        <!--调度-->
       <contrl ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 19 || approve.approve_id == 19"></contrl>
       <!--策划-->
       <scheme ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 18 || approve.approve_id == 18"></scheme>
       <postEdict  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 23 || approve.approve_id == 23"/>
       <salary  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 29 || approve.approve_id == 29"></salary>
       <event ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 1 || approve.approve_id == 1"></event>
       <event-manager  ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 38 || approve.approve_id == 38" />
       <logistics ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 30 || approve.approve_id == 30"></logistics>
       <!---->
       <red ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 32 || approve.approve_id == 32"></red>
       <douyin ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 33 || approve.approve_id == 33"></douyin>
       <!--抖音员工月度OKR考核表-->
       <dy-month ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 35 || approve.approve_id == 35"></dy-month>
       <!--天艺跑红员工月度OKR考核表-->
       <dy-month-red ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 36 || approve.approve_id == 36"></dy-month-red>
       <!-- <dy-month-manager ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo" :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield" :process="process" v-if="approve.id == 37 || approve.approve_id == 37"/> -->
       <!--游轮-->
       <point  ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process"  v-if="approve.id == 4 || approve.approve_id == 4"></point>
       <seal  ref="mychild"  :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve" :staff="staff" :departments="departments" :addDofield="addDofield"  :process="process" v-if="approve.id == 5 || approve.approve_id == 5"></seal>
       <price ref="mychild" :opinion="opinion" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve" :staff="staff" :departments="departments"  :addDofield="addDofield" :process="process" v-if="approve.id == 2 || approve.approve_id == 2"></price>
       <plan ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 6 || approve.approve_id == 6"></plan>
       <photo ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 34 || approve.approve_id == 34"></photo>
       <ywstop ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 3 || approve.approve_id == 3"></ywstop>
       <gjstop ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 41 || approve.approve_id == 41"></gjstop>
       <!-- <hr-exam ref="mychild" :curDepartment = "curDepartment" :userInfo = "userInfo"  :approve = "approve"  :staff="staff" :departments="departments"  :addDofield="addDofield"  :process="process" v-if="approve.id == 39 || approve.approve_id == 39" /> -->
    </section>
     <footer class="oa-footer"  v-if="$route.query.from !== 'done' && $route.query.from !== 'copy'">
      <div v-if="$route.query.from !== 'my'">
          <div class="oa-footer__value" v-if="$route.query.from != 'new'" :title="opinion">
            <textarea name="" id="" v-model="opinion"></textarea>
          </div>
      <div class="oa-footer__control"  v-if="$route.query.from === 'new'">
        <span @click="launchFunc">发起</span>
        <span>
          上传附件
          <el-upload
            class="upload-file"
            drag
            multiple
            :action="action"
            :before-upload="beforeUpload"
            >
          </el-upload>
        </span>
        <span @click="back">返回</span>
      </div>
      <div class="oa-footer__control" v-else>
        <span @click="agree(100)">同意</span>
        <span @click="reservation(75)">保留意见</span>
        <span @click="rebackFunc">退回</span>
        <span @click="appinterFunc">委托</span>
        <!-- <span>延期</span> -->
        <span>
          上传附件
          <el-upload
            class="upload-file"
            drag
            multiple
            :action="action"
            :before-upload="beforeUpload"
            >
          </el-upload>
        </span>
        <span v-print="'#printTest'">打印预览</span>
        <span @click="getJumpDo">可跳节点</span>
        <span>保存</span>
        <span  @click="back">返回</span>
      </div>
      </div>
      <div class="oa-footer__control" v-if="$route.query.from === 'my'">
        <span>
          上传附件
          <el-upload
            class="upload-file"
            drag
            multiple
            :action="action"
            :before-upload="beforeUpload"
            >
          </el-upload>
        </span>
      </div>
    </footer>
    <footer class="oa-footer"  v-if="$route.query.from === 'done'">
      <div class="oa-footer__control">
        <span @click="recheckFunc">
          撤回
        </span>
      </div>
    </footer>
    <el-dialog
    title="流转信息"
    :visible.sync="centerDialogVisible"
    width="30%"
    center>
    <div>
      <p>已成功保存，请选择下一步骤/主办人</p>
      <table class="oa-form__dialog-tab">
         <tr>
            <td>选择下一步骤</td>
            <td>
              <el-radio-group v-model="step" @change="stepFunc($event)">
              <el-radio :label="item.id" v-for="(item, index) in nodesList" :key="index">{{item.name}}</el-radio>
            </el-radio-group>
            </td>
         </tr>
         <tr>
            <td>主办人<em class="red" style="display:inline">*</em></td>
            <td>
              <el-radio-group v-model="mainPerson">
                <el-radio :label="item.id" v-for="(item, index) in userList" :key="index">{{item.truename}}</el-radio>
              </el-radio-group>
            </td>
         </tr>
      </table>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="centerDialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="agree2(100)">确 定</el-button>
    </span>
  </el-dialog>
  <jump :approve = "approve" :showJump="showJump" :jumpData="jumpData" @childJump = 'fatherJump'></jump>
  <appointer ref="appointerRef" :appointerList="appointerList" :appointVisile="appointVisile" @appointerChild = 'appointerFather' @childFlag = 'fatherFlag'></appointer>
  <rebackNode ref="rebackRef"  :approve = "approve"  :allStep="allStep" :rebackVisible="rebackVisible" @rebackChild = 'rebackFather'></rebackNode>
  </section>
</template>

<script>
import { event, eventManager, hrExam, gjstop, logistics, red, douyin, dyMonthManager, dyMonth, dyMonthRed, point, price, seal, plan, ywstop, administrativeAssistant, authoritie, photo, aviationManager, BD, customer, design, designAssistant, infotemp, project, ywManager, ywManager2, aviationPresident, cashier, cashierSale, cashierHost, contrl, scheme, BDoperate, postEdict, salary } from './index.js'
import mixin from '@/mixins/index.js'
import { getDepartment, getStartKey, getStaff, check, getNextNode, setNext, process, getAppointer, getReback, getJump, recheck } from '@/api/oa/index.js'
import { getToDayFunc } from '@/utils/domUtils.js'
import appointer from './components/appointer'
import rebackNode from './components/rebackNode'
import jump from './components/jump'
export default {
  name: '',
  mixins: [mixin],
  components: {
    hrExam,
    jump,
    event,
    eventManager,
    red,
    douyin,
    point,
    logistics,
    price,
    seal,
    plan,
    ywstop,
    gjstop,
    appointer,
    rebackNode,
    administrativeAssistant,
    authoritie,
    aviationManager,
    BD,
    BDoperate,
    customer,
    design,
    designAssistant,
    infotemp,
    project,
    ywManager,
    ywManager2,
    aviationPresident,
    cashier,
    cashierSale,
    cashierHost,
    contrl,
    scheme,
    postEdict,
    salary,
    photo,
    dyMonth,
    dyMonthRed,
    dyMonthManager
  },
  props: {},
  data () {
    return {
      allStep: [],
      appointerList: [],
      appointVisile: false,
      centerDialogVisible: false,
      rebackVisible: false,
      checkList: [],
      radio: 1,
      todayTime: getToDayFunc(),
      userInfo: {},
      curDepartment: {}, //  当前部门信息
      departments: [], // 部门
      headers: {
        authorization: 'authorization-text'
      },
      approve: JSON.parse(window.localStorage.getItem('approve')),
      nextUserList: [],
      // 内部人员
      staff: [],
      opinion: '',
      appointer: '',
      action: 'http://dw.tead.com.cn/api/oa/seal',
      nodes: [], // 下一步
      user: [], // 下一个主办人
      special_node: [],
      special_user: [],
      nodesList: [],
      userList: [],
      step: 0,
      mainPerson: 0,
      addDofield: [],
      process: [],
      appinter_id: 0,
      files: [],
      type: 100,
      showJump: false,
      jumpData: {},
      flag: false
    }
  },
  created () {
    this.userInfo = JSON.parse(window.localStorage.getItem('userInfo'))
  },
  mounted () {
    window.localStorage.setItem('is_end', 0)
    this.$nextTick(() => {
      this.getDepartmentFunc()
      if (this.$route.query.from === 'new') {
        this.getStartKey()
      } else {
        this.processDo()
        this.getNextStep()
      }
      this.getStaffFunc()
    })
  },
  watch: {
    '$route' () {
      console.log(123)
    }
  },
  destroyed () {},
  methods: {
    getJumpDo () {
      const params = {
        approve_node_id: this.approve.approve_node_id
      }
      if (!this.flag) {
        this.flag = true
      }
      getJump(params).then(res => {
        const { status, data } = res
        if (status) {
          this.jumpData = data
          if ((data.special_user && data.special_user.length) || (data.user && data.user.length)) {
            this.showJump = true
          } else {
            this.$message.error('暂无可跳节点')
          }
        }
        setTimeout(() => {
          this.flag = false
        }, 2000)
      })
    },
    fatherJump () {
      this.showJump = false
    },
    //  发起
    launchFunc () {
      this.$refs.mychild.submitFunc()
    },
    getDepartmentFunc () {
      // 获取部门名称
      getDepartment().then(res => {
        const { status, data } = res
        if (status) {
          this.departments = data
          this.departments && this.departments.forEach(e => {
            this.$set(e, 'value', e.id)
            this.$set(e, 'label', e.name)
            return e
          })
          this.curDepartment = data.filter(item => {
            return item.id === this.userInfo.department_id
          })
        }
      })
    },
    getStartKey () {
      const token = localStorage.getItem('token')
      getStartKey(this.approve.id, token).then(res => {
        const { status, data } = res
        if (status) {
          this.addDofield = data
        }
      })
    },
    getStaffFunc () {
      getStaff().then(res => {
        const { status, data } = res
        if (status) {
          this.staff = data
          this.staff && this.staff.forEach(e => {
            this.$set(e, 'value', e.id)
            this.$set(e, 'label', e.truename)
            return e
          })
        }
      })
    },
    setNextDo (type) {
      this.type = type
      if (type === 100) {
        if (!this.opinion) {
          this.opinion = '同意'
        }
      }
      if (type === 75) {
        if (!this.opinion) {
          this.opinion = '保留意见'
        }
      }
      if (type === 25) {
        if (!this.opinion) {
          this.opinion = '回退'
        }
      }
      const params = {
        openid: window.localStorage.getItem('token'),
        approve_node_id: this.approve.approve_node_id,
        next_node_id: this.step,
        workflow_id: this.approve.workflow_id,
        next_user_id: this.mainPerson,
        opinion: this.opinion,
        status: this.type
      }
      this.$refs.mychild.renderCustom(this.approve.workflow_id)
      const arr = new Set(this.$refs.mychild.field_ids)
      if (Array.from(arr).join()) {
        // 自定义事项才有这字段
        params.field_ids = this.$refs.mychild.field_ids.join()
        params.field_vals = this.$refs.mychild.field_vals.join()
      }
      setNext(params).then(() => {
        this.goFrom()
      })
    },
    agree2 () {
      this.centerDialogVisible = false
      if (!this.flag) {
        this.flag = true
        this.setNextDo(this.type)
        setTimeout(() => {
          this.flag = false
        })
      }
    },
    agree (type) {
      this.type = type
      if (this.approve.is_end === 1) {
        this.$message.error('流程已结束')
        return false
      }
      if (this.user.length >= 2 || (this.special_user && this.special_user.length > 0)) {
        this.centerDialogVisible = true
      } else {
        this.checkDo(type)
      }
    },
    reservation (type) {
      this.type = type
      if (!this.opinion) {
        this.opinion = '保留意见'
      }
      if (this.approve.is_end === 1) {
        this.$message.error('流程已结束')
        return false
      }
      // 0127
      if (this.user.length >= 2 || (this.special_user && this.special_user.length > 0)) {
        this.centerDialogVisible = true
      } else {
        this.checkDo(type)
      }
    },
    checkDo (type) {
      this.type = type
      if (type === 100) {
        if (!this.opinion) {
          this.opinion = '同意'
        }
      }
      if (type === 75) {
        if (!this.opinion) {
          this.opinion = '保留意见'
        }
      }
      if (type === 25) {
        if (!this.opinion) {
          this.opinion = '回退'
        }
      }
      if (!this.endFunc()) {
        this.$message.error('流程已结束，不能操作此功能')
        return false
      }
      const params = {
        openid: window.localStorage.getItem('token'),
        workflow_id: this.approve.workflow_id,
        approve_node_id: this.approve.approve_node_id,
        opinion: this.opinion,
        status: this.type,
        appointer: this.appointer
      }
      // if (this.approve.approve_id !== 1 && this.approve.approve_id !== 2 && this.approve.approve_id !== 5) {
      this.$refs.mychild.renderCustom(this.approve.workflow_id)
      const arr = new Set(this.$refs.mychild.field_ids)
      if (Array.from(arr).join()) {
        // 自定义事项才有这字段
        params.field_ids = this.$refs.mychild.field_ids.join()
        params.field_vals = this.$refs.mychild.field_vals.join()
      }
      check(params).then(() => {
        this.goFrom()
        this.$store.commit('getUpload', [])
      })
    },
    endFunc () {
      const isEnd = window.localStorage.getItem('is_end')
      if (isEnd === '1') {
        return false
      } else {
        return true
      }
    },
    back () {
      this.goFrom()
    },
    beforeUpload (file) {
      if (!this.endFunc()) {
        this.$message.error('流程已结束，不能操作此功能')
        return false
      }
      const fd = new FormData()
      fd.append('file', file)
      fd.append('openid', window.localStorage.getItem('token'))
      if (this.approve.workflow_id) {
        fd.append('workflow_id', this.approve.workflow_id)
      }
      this.$store.dispatch('uploadDo', fd).then((res) => {
        console.log(res)
        const { status } = res
        if (status && this.approve.workflow_id) {
          this.$store.dispatch('filesDo')
        }
      })
    },
    getNextStep () {
      const params = {
        approve_node_id: this.approve.approve_node_id
      }
      getNextNode(params).then(res => {
        const { status, data } = res
        if (status) {
          // 下一步
          this.nodes = data.nodes
          // 主办人
          this.user = data.user
          this.userList = data.user
          this.nodesList = data.nodes
          this.special_user = data.special_user
          data.special_node && this.nodesList.push(data.special_node)
          if (this.user && this.user.length !== 0) {
            this.mainPerson = this.userList[0].id
            this.step = this.nodesList[0].id
          }
          console.log(this.nodesList)
          if (this.nodesList && this.nodesList.length !== 0 && this.userList.length) {
            this.mainPerson = this.userList[0].id
            this.step = this.nodesList[0].id
          }
        }
      })
    },
    stepFunc (e) {
      // debugger
      console.log(e)
      if (e === 224 || e === 227 || e === 225 || e === 226 || e === 242) {
        this.userList = this.special_user
      } else {
        this.userList = this.user
      }
      this.mainPerson = this.userList[0].id
    },
    processDo () {
      const approve = JSON.parse(window.localStorage.getItem('approve'))
      const params = {
        workflow_id: approve.workflow_id
      }
      process(params).then(res => {
        const { status, data } = res
        if (status) {
          this.process = data
        }
      })
    },
    appinterFunc () {
      if (!this.endFunc()) {
        this.$message.error('流程已结束，不能操作此功能')
        return false
      }
      const params = {
        approve_node_id: this.approve.approve_node_id
        // opinion: this.opinion
      }
      getAppointer(params).then(res => {
        const { status, data } = res
        if (status) {
          if (data) {
            this.appointerList = data
          }
          console.log(this.appointerList, this.appointerList.length)
          if (!this.appointerList || this.appointerList.length === 0 || !data) {
            this.$message.error(res.msg)
            this.appointVisile = false
          } else {
            this.appointVisile = true
          }
        }
      })
    },
    appointerFather () {
      this.appointVisile = false
    },
    // 召回
    recheckFunc () {
      const params = {
        approve_node_id: this.approve.approve_node_id,
        workflow_id: this.approve.workflow_id
      }
      recheck(params).then(res => {
        const { status } = res
        if (status) {
          this.$router.push({ name: 'oaList', query: { activeName: 5 } })
        }
      })
    },
    rebackFunc () {
      if (!this.endFunc()) {
        this.$message.error('流程已结束，不能操作此功能')
        return false
      }
      const params = {
        approve_node_id: this.approve.approve_node_id
      }
      getReback(params).then(res => {
        const { status, data } = res
        if (status) {
          if (data && data.length) {
            this.allStep = data
          } else {
            this.$message.error('没有可回退步骤')
          }
          if (!this.allStep || this.allStep.length === 0 || !data) {
            this.$message.error(res.msg)
            this.rebackVisible = false
          } else {
            this.rebackVisible = true
          }
        } else {
          this.$message.error(res.msg)
        }
      })
    },
    rebackFather () {
      this.rebackVisible = false
    },
    fatherFlag (par) {
      this.appointer = par
      this.checkDo(50)
      this.appointVisile = false
    }
  }
}

</script>
<style lang="less" scoped>
  .oa-footer {
    position: fixed;
    left: 107px;
    right: 20px;
    bottom: 0;
    height: 100px;
    z-index: 999;
    background: #455bab;
    padding: 6px 6px 0;
    .upload-file {
      position: absolute;
      left:0;
      right:0;
      top:0;
      bottom:0;
      z-index: 1;
      opacity: 0;
    }
    &__ {
      &value {
        height: 60px;

        textarea {
          display: block;
          width: 100%;
          height: 100%;
          resize: none;
          border: 0;
          outline: 0;
          font-size: 14px;
          line-height: 20px;
          padding: 10px;
          box-sizing: border-box;
        }
      }

      &control {
        display: flex;
        align-items: center;
        margin-top: 6px;
        // padding: 6px 0;

        span {
          position: relative;
          display: block;
          height: 22px;
          line-height: 22px;
          padding: 0 10px;
          background: #fff;
          font-size: 14px;
          color: #455bab;
          margin-right: 6px;
          border-radius: 3px;
          overflow: hidden;
          cursor: pointer;
          ._upload {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            opacity: 0;
          }
        }
      }
    }
  }
</style>
